\subsection{Ramifications of holomorphic maps on Riemann surfaces}
\tcr{In this section we look at the concept of ramification, which generalise the branching of complex holomorphic functions. 
Given some condifion on this functions it determine where it fails to be form a "covering"
\noindent\begin{description}
\item[Motivating examples]
\noindent Let $f=id_{\CC}$, be the identity function on $\CC$, we will see later that $\forall n \in \ZZ_{>1}, \nexists g_n:\CC\rightarrow\CC$, a holomorphic function, such that $(g_n(z))^n=f(z)=z\forall z\in \CC$. That, $\frac{1}{2\pi i}\displaystyle\int_{\CC}\frac{f\prime(z)}{f(z)}dz=\frac{1}{2\pi i}\displaystyle\int_{\CC}\frac{1}{z}dz=1\neq n$, hence such holomorphic $g_n$ does not exist.
\end{description}
}
\begin{definition}[Holomorphic functions on $\CC$]
\noindent Let $f:U\rightarrow \CC$, be a complex valued function defined on the open subset $U\subseteq \CC$. If the complex derivative $f\prime(z_0):=\frac{\partial}{\partial z}|_{z_0}f(z)$ exists for all $z_0\in U$, we say $f$ is holomorphic on $U$. We denote the class of holomorphic functions on $U$ by $\HH(U)$.
\end{definition}
\begin{lemma}\label{Zeros}
\noindent Let $U\subseteq \CC$, be an \underline{connected} non-empty open set, $f\in \HH(U)$, $f\neq 0$. Then $Z(f)$, the set of zeros of $f$ in $U$, does not have accumulation points in $U$. Furthermore, $$\forall z_0\in Z(f),\exists! m\in \ZZ_{\geq1}:f(z)=(z-z_0)^m g(z) \forall z\in U$$ Where, $g\in \HH(U)$, and $g(z_0)\neq 0$.
\end{lemma}
\begin{proof}
\noindent See \cite[Th.10.18, P209]{Rud70}.
\end{proof}
\noindent Such an integer $m$ in the above settings is called the order of zeros of $f$ at $z_0$, and denoted by $ord_{z_0}(f)$.
\begin{lemma}\label{Harmonic-nth-root}
\noindent Let $0\in U\subseteq \CC$, be an \underline{connected} non-empty open set, $f\in \HH(U)$, $f(0)\neq0$. Then, $\exists U_0\subset U$ a neighbourhood centred at $0$, such that $\forall n\in \ZZ^{\ast}, \exists g_n\in \HH(U_0)$, such that $f(z)=(g_n(z))^n,\forall z\in U_0$.
\end{lemma}
\begin{proof}
\noindent The subset $U$ is connected, hence $Z(f)$ does have accumulation points in $U$. Then, there exists a neighbourhood $U_0$, centred at $0$, homomorphic to the open disc, such that $f_0:=f|_{U_0}$ has no zeros in $U_0$. We note $f_0\in \HH(U_0)$, then using \cite[Th.13.18, P 262]{Rud70}, there exists a holomorphic logarithm function $g\in \HH(U_0)$ such that $f(z)=f_0(z)=e^{g(z)}\forall z\in U_0$. Hence, $\forall n\in \ZZ^{\ast}$, there exists a holomorphic $n^{th}$-root function $ g_n=\frac{1}{n}g\in \HH(U_0)$ such that $f(z)=f_0(z)=(g_n(z))^n\forall z\in U_0$.
\end{proof}
\begin{lemma}[Implicit function theory]\label{IFT}
\end{lemma}
\begin{definition}[Riemann Surfaces]
\noindent Riemann surfaces is a complex manifold of complex dimension one.
\end{definition}
\begin{example}[Riemann Sphere] $\PR_{\CC}^1$.
\end{example}
\begin{definition}[Holomorphic maps on Riemann surfaces]
\noindent Let $f:X\rightarrow Y$ be a map between Riemann surfaces, $p\in X$, we say that $f$ is holomorphic at $p$, if there exist charts $(U,\phi)$ of X, and $(V,\psi)$ of $Y$, such that $p\in U, f(p)\in V$, and $F:=\psi\circ f\circ\phi^{-1}$ is holomorphic at $\phi(p)$. We say that $f$ is holomorphic iff it is holomorphic at every $p\in X$.
\end{definition}
\begin{lemma}[Local normal form]
\noindent Let $f:X\rightarrow Y$ be a non-constant holomorphic map between Riemann surfaces. Then, $\forall p\in X,\exists! m\in \ZZ_{\geq1}$ such that $\exists (U,\phi)$ a chart of $X$ centred at $p$, and a $\exists (V,\psi)$ a chart of Y centred at $f(p)$, such that $F(z):=\psi(f(\phi^{-1}(z)))=z^m,\forall z\in \phi(U)$.
\end{lemma}
\begin{proof}
\noindent Let  $(U_0,\phi_0)$ be connected chart of $X$ centred at $p$, and a $(V,\psi)$ a chart of Y centred at $f(p)$. Let, $F_0:=\psi \circ f \circ \phi_0^{-1}$, $F_0(0)=0$, then by lemma \ref{Zeros}, $$\exists!m\in \ZZ_{\geq1}:F_0(w)=w^m G(w),\forall w\in \phi_0(U')$$
Where, $G\in \HH(\phi(U_0))$, and $G(0)\neq 0$.\\
\noindent Due to lemma \ref{Harmonic-nth-root}, there exists a chart $(U_1,\phi_1)$, $U_1\subset U_0, \phi_1=\phi_0|_{U_1}$, $H\in \HH(\phi_1(U_1))$, such that $$F_0(w)=(w H(w))^m,\forall w\in \phi_1(U_1).$$
\noindent Let $T(w):=w H(w)$, we notice that $T\in \HH(U)$, and $T(0)\neq 0$. Then, using \ref{IFT}, there exists a chart $(U,\phi_2)$, $U\subset U_1, \phi_2=\phi_1|_U$, $H\in \HH(\phi_2(U))$, such that $$S:=T|_{\phi_2(U)}:\phi_2(U)\rightarrow T(\phi_2(U))$$  is invertible, and $S^{-1}\in\HH(T(\phi_2(U)))$.\\
\noindent Let $\phi=S\circ \phi_2$, then we have the chart $(U,\phi)$ of $X$, centred at $p$. Let $F:=\psi \circ f \circ \phi^{-1}$, then we find that 
$$F=\psi\circ f\phi_2^{-1}\circ S^{-1}=F_0|_{\phi_2(U)}\circ S^{-1}=(S\circ S^{-1})^m=(-)^m.$$
\tcb{m is a toplogical property, finalise the proof.}
\end{proof}

\begin{definition}[Multiplicity]
\noindent $mult_p(f)$.
\end{definition}
\begin{remark}
\noindent Multiplicity is a topological property.
\end{remark}
\begin{lemma}
Let $f:X\rightarrow Y$ be a holomorphic map between Riemann surfaces, $p\in X$, $(U,\phi)$ a chart of $X$ contains $p$ (not necessary centred), $(V,\psi)$ a chart of $Y$ contains $f(p)$, $F:=\psi\circ f\circ\phi^{-1}$. Then,
$$mult_p(f)=1+ord_{\phi(p)}(\frac{dF}{dz})$$
Where $z$ is the local coordinate of $(U,\phi)$.
\end{lemma}
\begin{definition}[Ramification point]
Let $f:X\rightarrow Y$ be a non-constant holomorphic map between Riemann surfaces, $p\in X$ is called a ramification point for $f$ iff $mult_p(f)>1$. Then, we also call $f(p)$ a branch point for $f$.
\end{definition}
\noindent How to connect with smooth affine plane curve.
\begin{lemma}
Let $X=V(f)$ be a smooth affine plane curve in $\AA^2_{\CC}$. Then, the projection $\pi:X\rightarrow \AF^1_{\CC}$, given by $\pi(x,y)=y$, is ramified at $p\in X$ iff $\frac{\partial}{\partial x}|_p(f)=0$.
\end{lemma}
\begin{lemma}
Let $X=V(f)$ be a smooth projective plane curve in $\PR^2_{\CC}$. Then, the projection $\pi:X\rightarrow \PR^1_{\CC}$, given by $\pi[x:y:z]=[y:z]$, is ramified at $p\in X$ iff $\frac{\partial}{\partial x}|_p(f)=0$.
\end{lemma}
\subsubsection*{Ramification of maps on compact Riemann surfaces}
\begin{lemma}
Let $f:X\rightarrow Y$ be a non-constant holomorphic map between compact Riemann surfaces. Then $f$ has finitely many ramification points.
\end{lemma}
\begin{definition}
Let $f:X\rightarrow Y$ be a non-constant holomorphic map between compact Riemann surfaces. Then, $\forall y\in Y$, we define $d_y(f)=\displaystyle\sum_{p\in f^{-1}(y)}mult_p(f)$.
\end{definition}
Explain the name degree.
\begin{proposition}
Let $f:X\rightarrow Y$ be a non-constant holomorphic map between compact Riemann surfaces. Then, $\forall y\in Y$, $d_y(f)$ is independent of the choice of $y\in Y$.
\end{proposition}
\begin{definition}[The degree of a holomorphic map between compact Riemann surfaces]

\end{definition}
\begin{theorem} [Hurwitz's Formula]
Let $f:X\rightarrow Y$ be a non-constant holomorphic map between compact Riemann surfaces. Then,
$$2g(X)-2=deg(f)(2g(Y)-2)+\displaystyle\sum_{p\in X}(mult_p(f)-1)$$.
\end{theorem}



\begin{definition}[Meromorphic functions]
\noindent Let $f:X\rightarrow \CC$ be complex valued function on Riemann surfaces $X$. 
\end{definition}
\noindent Relation to covering maps, counting properly.\\
\noindent Set of ramification points of compact is finite.
%\subsection{Ramification of ringed spaces morphisms}
\subsection{Ramification of scheme morphisms}
In this section we follow \cite{Mil12}, \cite{Mum99}, \cite{Vak13} and \cite{Har77}.
\noindent \tcb{It gives a measure to determine when a morphism to form a covering.}
\noindent \tcb{We saw in the analytical case that unramified maps that the cardinality of inverse images is constant}. Flatness, guarantees that dimension of the inverse image is invariant, if not empty. \tcb{Below, the same concept was generalise to ringed spaces morphisms, as follows:}
%%\begin{definition}[Cardinality of ringed spaces morphisms]\end{definition}
\begin{definition}
\noindent Let $f:Y\rightarrow X$ be a morphism of schemes, $y\in Y$, $\gom_y,\gon_{f(y)}$ the maximal ideals of $\bcO_{Y,y},\bcO_{X,f(y)}$, respectively. we say that $f$ is unramified at $y\in Y$ iff:
\begin{enumerate}
\item $f$ is \tcb{locally of finite presentation}.
\item $\gom_y$ is the extension of $\gon_{f(y)}$ trough $f^{\#}_{y}$,i.e. $f^{\#}_{y}(\gon_{f(y)})\cdot \bcO_{Y,y} =\gom_y$.
\item $\bcO_{Y,y}/\gom_y$ is a finite separable field extension of $\bcO_{X,f(y)}/\gon_{f(y)}$.
\end{enumerate}
\end{definition}
\begin{example}
\noindent Let $\kk$ be an algebraically closed field, $C$ be an elliptic curve in $\PR^2_{\kk}$, given in Weierstass form $$y^2z+a_1xyz+a_2yz^2=x^3+b_1x^2z+b_2xz^2+b_3z^3$$let $\pi:C\dashrightarrow \PR^1$ be the projection on the $x$-axis, given by $f([x:y:z])=[x:z]$. Then the induced regular morphism on $C_|{{z\neq 0}}$ has three ramification points.
\end{example}
\begin{proof}[Solution]
\noindent $C_|{{z\neq 0}}\cong \Spec\ \kk[x,y]/(c)$, where $c:=y^2+a_1xy+a_2y-x^3-b_1x^2-b_2x-b_3$, hence the morphism is $$f:\Spec\ \kk[x,y]/(c)\twoheadrightarrow\Spec\ \kk[x]\cong\AF_{\kk}^1  \hookrightarrow \PR_{\kk}^1$$is induced by the canonical morphism of rings $\varphi:\kk[x]\rightarrow \kk[x,y]/(c)$. $\kk[x,y]/(c)$ is a finitely presented algebra over $\kk[x]$, hence $f_{|z\neq 0}$ is locally of finite presentation.\\
We rewrite $c=(y+\frac{1}{2}a_1x+\frac{1}{2}a_2)^2-e(x)$, for $e$ a monic polynomial of degree three, that has three distinct roots, that $c$ defines an elliptic curve. To ease notation, we write $A:=\kk[x]$, and $B=\kk[x,y]/(c)$.
Let $\gop\in C_{|z\neq 0}$, $f_{|z\neq 0}(\gop)=\varphi^{-1}(\gop)$. If $\gop$ closed in $C_{|z\neq 0}$, then $\gop=(x-\alpha,y-\beta)$ such that $(c)\subseteq (x-\alpha,y-\beta)$. Let $$\varphi':A_{(x-\alpha)}\rightarrow B_{(x-\alpha,y-\beta)}$$ be the induced local morphism of rings, that, $f_{|z\neq 0}((x-\alpha,y-\beta))=(x-\alpha)$.\\ $\varphi'((x-\alpha))\cdot B_{ (x-\alpha,y-\beta)}\subseteq (x-\alpha,y-\beta)\cdot  B_{ (x-\alpha,y-\beta)}$, in order to check the equality we distinguish two cases:
\begin{enumerate}
\item $\alpha$ is a root of $e$, then $\beta=-\frac{1}{2}(\alpha a_1+a_2)$, since $e$ has three distinct roots, we find that $(x-\alpha)=\frac{1}{(x-\alpha_2)(x-\alpha_3)}(y+\frac{1}{2}a_1x+\frac{1}{2}a_2)^2$, that $(x-\alpha_2)(x-\alpha_3)$ are units in $B_{(x-\alpha,y-\beta)}$, where $\alpha_2,\alpha_3$ are the other two roots of $e$. Hence, $$\varphi'((x-\alpha))\cdot  B_{ (x-\alpha,y-\beta)}=\left(((y-\beta)^2) B_{ (x-\alpha,y-\beta)}\right)\neq (x-\alpha,y-\beta) B_{ (x-\alpha,y-\beta)}.$$ Hence, $ (x-\alpha,y-\beta)$ is a ramification point for $f$, i.e. $[\alpha:-\frac{1}{2}(\alpha a_1+a_2):1]$ is a ramification point of $f$ for $\alpha$ is a root of $e$.\\
\item $\alpha$ is not a root of $e$, then $\beta_1,\beta_2=-\frac{1}{2}(\alpha a_1+a_2)\pm \sqrt{f(\alpha)}$, we notice that $(y-\beta_1)-(y-\beta_2)=2\sqrt{e(\alpha)}\neq 0 \in \kk$, hence $y-\beta_i\nin (x-\alpha,y-\beta_j)\cdot B_{ (x-\alpha,y-\beta_j)}$ for $i\neq j$.\\
$(y-\beta_1)(y-\beta_2)=(y+\frac{1}{2}(\alpha a_1+a_2))^2-e(\alpha)=e(x)-e(\alpha)$ which is divisible by $(x-\alpha)$, hence\\
$$\varphi'((x-\alpha))\cdot  B_{ (x-\alpha,y-\beta_i)}=(x-\alpha,y-\beta_i) B_{ (x-\alpha,y-\beta_i)}.$$
We notice that $B_{ (x-\alpha,y-\beta_i)}/\gom_{B_{ (x-\alpha,y-\beta_i)}}$, and $A_{(x-\alpha)}/\gom_{A_{(x-\alpha)}}$ are canonically isomorphic to $\kk$, hence, $B_{ (x-\alpha,y-\beta_i)}/\gom_{B_{ (x-\alpha,y-\beta_i)}}$ is a finite separable field extension of $A_{(x-\alpha)}/\gom_{A_{(x-\alpha)}}$, and $ (x-\alpha,y-\beta_i)$ are unramification points for $f$ for $i=1,2$.
\end{enumerate}
\end{proof}
\begin{remark}
Notice that the number of ramification points depends on the projection, for example let $C$ be the elliptic curve in $\CC$ given by $y^2 z=(x-z)x(x+z)$, we found that its projection of its affinization $z\neq 0$, on the $x$-axis, has three ramification points $[1:0:1],[0:0:1]$ and $[-1:0:1]$. However, the projection of its affinization $xz\neq 0$, on the $z$-axis has only two ramification points.
\end{remark}
\begin{proof}[Solution]
We have $$g:\Spec\ \kk[z,y]/(y^2z+(z-1)(z+1))\rightarrow \Spec\ \kk[z]\cong\AF_{\kk}^1\hookrightarrow \PR_{\kk}^1$$induced by the canonical morphism $\varphi:\kk[z]\rightarrow \kk[z,y]/(y^2z+z^2-1)$. $\kk[z,y]/(y^2z+z^2-1)$ is finitely represented algebra over $\kk[z]$, hence $g$ is locally of finite presentation. We write $A:=\kk[z]$, $B:=\kk[z,y]/(y^2z+z^2-1)$. $\let \gop\in \Spec \ B, g(\gop)=\varphi^{-1}(\gop)$. If $\gop$ is closed in $\Spec \ B$, then $\gop=(z-\alpha,y-\beta)$ such that $(y^2z+z^2-1)\subseteq (z-\alpha,y-\beta)$. Let $$\varphi':A_{(z-\alpha)}\rightarrow B_{(z-\alpha,y-\beta)}$$ be the induced local morphism of rings, that, $g((z-\alpha,y-\beta))=(z-\alpha)$.\\ $\varphi'((z-\alpha))\cdot B_{ (z-\alpha,y-\beta)}\subseteq (z-\alpha,y-\beta)\cdot  B_{ (z-\alpha,y-\beta)}$, in order to check the equality we distinguish two cases:
\begin{enumerate}
\item $\alpha=1 or -1$, then $\beta=0$, $(z+\alpha)$ and $z$ are units in $B_{(z-\alpha,y)}$. Hence, $(z-\alpha)=\frac{1}{(z+\alpha)} y^2z$, i.e. 
$$\varphi'((z-\alpha))\cdot  B_{ (z-\alpha,y)}=\left((y^2) B_{ (z-\alpha,y)}\right)\neq (z-\alpha,y) B_{ (z-\alpha,y)}.$$ Hence, $ (z-\alpha,y)$ is a ramification point for $g$, i.e. $[1:0:1]$ are ramification points of $g$.\\
\item $\alpha=1, or-1$,  we notice that $\alpha\neq 0$, that it does not exist $\beta\in \kk$ such that $(y^2z+z^2-1)\subseteq (z,y-\beta)$. Let $\gamma=\frac{1-\alpha^2}{\alpha}$, then $\beta_1,\beta_2=\pm\sqrt{\gamma}$, we notice that $(y-\beta_1)-(y-\beta_2)=2\sqrt{\gamma}\neq 0 \in \kk$, hence $z,y-\beta_i\nin (z-\alpha,y-\beta_j)\cdot B_{ (z-\alpha,y-\beta_j)}$ for $i\neq j$.\\
$(y-\beta_1)(y-\beta_2)z\alpha=\alpha y^2z-z(-\alpha^2+1)=-(z-\alpha)(\alpha z+1)$, divisible by $(z-\alpha)$, hence\\
$$\varphi'((z-\alpha))\cdot  B_{ (z-\alpha,y-\beta_i)}=(z-\alpha,y-\beta_i) B_{ (z-\alpha,y-\beta_i)}.$$
We notice that $B_{ (z-\alpha,y-\beta_i)}/\gom_{B_{ (z-\alpha,y-\beta_i)}}$, and $A_{(z-\alpha)}/\gom_{A_{(z-\alpha)}}$ are canonically isomorphic to $\kk$, hence, $B_{ (z-\alpha,y-\beta_i)}/\gom_{B_{ (z-\alpha,y-\beta_i)}}$ is a finite separable field extension of $A_{(z-\alpha)}/\gom_{A_{(z-\alpha)}}$, and $ (z-\alpha,y-\beta_i)$ are unramification points for $g$ for $i=1,2$.
\end{enumerate}
\end{proof}
\tcr{important note about counting the inverse images} \\
\noindent Let $\goq$ be the point corresponding to the maximal ideal $(x-\alpha)\subset\kk[x]$. We notice that the scheme-theoretical pre-image of $f$ at the ramification points are reduced points. For $\alpha\in{-1,0,1}$ then the scheme-theoretical pre-image $$
\begin{array}{ll}
f^{-1}(\goq)=&\Spec\ \kk[x,y]/(y^2-x^3+x)\times_{\Spec \ \kk[x]}\Spec\ \kk(\gop)\cong\Spec (\kk[x,y]/(y^2-x^3+x) \otimes_{\kk[x]} \kk(\goq)\cong\\&\Spec \ \kk[y]/(y^2)
\end{array}
$$.
\noindent Whereas, that the scheme-theoretical pre-image of $f$ at the unramification points are disjoint union of \tcr{geometrical} reduced points. That, for $\alpha\nin{-1,0,1}$ then the scheme-theoretical pre-image 
$$
\begin{array}{ll}
f^{-1}(\goq)=&\Spec\ \kk[x,y]/(y^2-x^3+x)\times_{\Spec \ \kk[x]}\Spec\ \kk(\gop)\cong\Spec (\kk[x,y]/(y^2-x^3+x) \otimes_{\kk[x]} \kk(\goq)\cong\\
&\Spec \ \kk[y]/(y^2-\alpha^3+\alpha)\cong\Spec \ \kk[y]/((y-\sqrt{\alpha^3+\alpha})(y+\sqrt{\alpha^3+\alpha}))\cong\\&\Spec \left( \kk[y]/(y-\sqrt{\alpha^3+\alpha}) \times \kk[y]/(y+\sqrt{\alpha^3+\alpha})\right)\cong\\&\Spec \ \kk[y]/(y-\sqrt{\alpha^3+\alpha}) \bigsqcup\ \kk[y]/(y+\sqrt{\alpha^3+\alpha})\cong\Spec \ \kk \bigsqcup \Spec\  \kk
\end{array}
$$

%\noindent \begin{definition}[Ramification of ringed spaces morphisms] \noindent Let  be a morphism of schemes. The support of the quasicoherent sheaf  is called the ramification locus of  and the image of the ramification locus, , is called the branch locus of . If  we say that  is formally unramified and if  is also of locally finite presentation we say that  is unramified [see Vakil's notes].\end{definition}


%\begin{definition}Let $f:Y\rightarrow X$ a morphism of schemes, we say that $f$ is formally unramified if \end{definition}
%\begin{definition} Let $f:Y\rightarrow X$ a morphism of schemes, we say that $f$ is unramified iff it is Locally of finite presentation and formally unramified.\end{definition}
\black
\subsection{Properties of \'Etale morphisms}
